{% extends "base.html" %}
{% load staticfiles %}
{% block content %}
<div class="row">
    <div class="col-md-6 col-md-offset-3 center">
        <form class="form-inline" role="form" action="{% url "analysis.views.search" %}" enctype="multipart/form-data" method="post">{% csrf_token %}
            <p class="text-muted" style="margin-top: 5px;">For details on how to perform searches, get some <a href="#help" data-toggle="collapse">help</a>.</p>

            <div class="form-group">
                <label class="sr-only" for="form_search">Search term</label>
                <input type="text" class="form-control" id="form_search" name="search" size=50 placeholder="Search term" />
            </div>
            <button type="submit" class="btn btn-primary">Search</button>
        </form>
    </div>
</div>
<div id="results">
    {% include "analysis/search_results.html" %}
</div>

<script type="text/javascript">
$("#form_search").on("input", function() {
    CuckooWeb.post("{% url "analysis.views.search" %}", {
        raw: true,
        search: $("#form_search").val(),
    }, function(data) {
        $("#results").html(data);
    });
});
</script>
{% endblock %}
